﻿using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;
using Microsoft.Xna.Framework.Net;
using Microsoft.Xna.Framework.Storage;
using Microsoft.Xna.Framework.Graphics.PackedVector;

namespace ProceduralGolf
{
    class GolfClub
    {
        public static GolfClub[] Clubs = {
                                         
                                             new GolfClub("Driver", 95, MathHelper.PiOver4),
                                             new GolfClub("3-wood", 85, MathHelper.PiOver4),
                                             new GolfClub("5-wood", 80, MathHelper.PiOver4),
                                             new GolfClub("2-iron", 80, MathHelper.PiOver4),
                                             new GolfClub("3-iron", 78, MathHelper.PiOver4),
                                             new GolfClub("4-iron", 76, MathHelper.PiOver4),
                                             new GolfClub("5-iron", 73, MathHelper.PiOver4),
                                             new GolfClub("6-iron", 70, MathHelper.PiOver4),
                                             new GolfClub("7-iron", 67, MathHelper.PiOver4),
                                             new GolfClub("8-iron", 64, MathHelper.PiOver4),
                                             new GolfClub("9-iron", 60, MathHelper.PiOver4),
                                             new GolfClub("PW", 50, 0),
                                             new GolfClub("SW", 40, MathHelper.ToRadians(60))
                                         };

        private float maxForce;
        public float MaxForce { get { return maxForce; } }

        private float pitch;
        public float Angle { get { return pitch; } }

        private String name;
        public String Name { get { return name; } }

        private GolfClub(String name, float maxForce, float angle)
        {
            this.name = name;
            this.maxForce = maxForce;
            this.pitch = angle;
        }

        public Vector3 hit(float yaw, float power)
        {
            Matrix rotation = Matrix.CreateFromYawPitchRoll(yaw, pitch, 0.0f);
            return Vector3.TransformNormal(-Vector3.UnitZ, rotation) * maxForce * power;
        }
    }
}
